<div class="layui-body" id="pocTest" style="padding: 15px;">
    <div class="layui-row">
        <div class="layui-col-md4">
            <div class="grid-demo grid-demo-bg1">&nbsp;</div>
        </div>
        <div class="layui-col-md4">
            <div class="grid-demo grid-demo-bg1">
                <br />
                <br />
                <br />
                <br />
                <div class="h1 col-md-offset-4"><b>端口扫描</b></div>
                <br />
                <hr>
                <form method="post" role="form" action="" name="scriptform" target="_blank">
                    {% csrf_token %}
                    <!-- scriptID这个元素一定要，用来让后台识别是调用哪个脚本 -->
                    <div class="form-group" hidden>
                        <label for="scriptID">脚本名称</label>
                        <input type="text" class="form-control" id="scriptID" name='scriptID' placeholder="脚本ID"
                            value="{{ script_id }}">
                    </div>
                    <!-- 下面按需增加元素 -->
                    <div class="form-group">
                        <label for="num1">目标域名</label>
                        <input type="text" class="form-control" id="num1" name='-d' placeholder="目标域名">
                    </div>
                    <button class="btn btn-success col-md-offset-2 btn-lg" onclick="submissions()"><b>提 交</b></button>
                    <button class="btn btn-danger col-md-offset-2 btn-lg" onclick="asytasks()"><b>加入任务队列</b></button>
                </form>
            </div>
        </div>
        <div class="layui-col-md4">
            <div class="grid-demo grid-demo-bg1">&nbsp;</div>
        </div>
    </div>
</div>
<script>
    // 点【提交】时响应，后台直接处理返回结果。适合时间需要立即响应结果且花费时间少的任务
    function submissions() {
        document.scriptform.action = "{% url 'scriptCall'  %}";
        document.scriptform.submit();
    }
    // 点【加入任务队列】时响应，加入到后台异步任务队列。适合花费时间长的任务。
    function asytasks() {
        document.scriptform.action = "{% url 'tasksQueue'  %}";
        document.scriptform.submit();
    }
</script>